fix(signals): clear uninitialized optimistic async completion#2806
fix(signals): clear uninitialized optimistic async completion#2806brenelz wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 362fc2f The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will not alter performance
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | omit |
172.1 µs | 215.9 µs | -20.28% |
| ⚡ | merge |
285.2 µs | 222.1 µs | +28.41% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing brenelz:fix/optimistic-first-refresh-pending (362fc2f) with next (9892af2)
…ing-node path (closes #2806) A resting createOptimistic async source (no active override) wrote its async completion straight to `_value`, skipping the pending-node commit that clears STATUS_UNINITIALIZED. When `isPending(() => data())` was the only consumer — no value-observer to drive the commit — the flag was never cleared, so the first refresh() read as an initial load and isPending never reported true. Route the resting completion through queuePendingNode + the shared commit so a resting optimistic node is indistinguishable from a plain async memo, removing the divergence rather than special-casing the flag. The active- override branch is unchanged (still holds the fresh value as the revert target). Supersedes #2806's minimal flag patch. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Testing